package com.shxy.entity;

import com.shxy.entity.common.enums.DistrictEnum;
import com.shxy.entity.common.enums.EthicEnum;
import com.shxy.entity.common.enums.PoliticalEnum;
import com.shxy.entity.common.enums.RoleEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.List;

@Entity
@Table(name = "tb_user")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class User {

    @Id
    @GeneratedValue(generator = "jpa-uuid")
    @Column(length = 32)
    private String id;                                      // 编号
    @Column(nullable = false, length = 64)
    private String password;                                // 密码
    private String introduction;                            // 简介
    private String avatar;                                  // 头像

    @Transient
    private List<RoleEnum> roles;                           // 角色列表

    @OneToOne
    @JoinColumn(name = "employee_id", nullable = false, unique = true)
    private Employee employee;                              // 员工
}
